package com.run2code.design.creational.factory;

import com.run2code.design.creational.factory.out.AliOss;

import java.util.Map;

/**
 * 上传子类 oss，继承了抽象类，并且调用了上传至oss的方法
 * 关注公众号【奔跑的码畜】，一起进步不迷路
 *
 * @author 第七人格
 * @date 2023/11/15
 */
public class AliOssUpDownloader extends BaseUpDownloader {

    private AliOss aliOss;

    public AliOssUpDownloader() {
        this.aliOss = new AliOss();
    }

    @Override
    public String doUpload(String filePath, String fileName, Map<String, String> param) {
        aliOss.aliUpload(fileName, param.get("ossId"), param.get("token"));
        return "AliOssUpDownloader upload success";
    }
}